package com.spring.example.rocket.Listener;

import com.spring.example.rocket.AbstractListener;
import com.spring.example.rocket.MqMessage;
import com.spring.example.rocket.dto.TestDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.springframework.stereotype.Component;

/**
 * author: xiaochi
 * date: 2025/10/10
 */
@Component
@Slf4j
@RocketMQMessageListener(topic = "test-topic", selectorExpression = "test-topic-001", consumerGroup = "test-group")
public class TestListener extends AbstractListener<TestDto> {

    @Override
    protected boolean handleMessage(MqMessage<TestDto> message) {
        System.out.println(message.getBody());
        System.out.println("id==="+message.getMessageId());
        return true;
    }
}
